package homework

import (
	"fmt"
	"net/http"
)

func headers(w http.ResponseWriter, r *http.Request) {
	for key := range r.Header {
		fmt.Fprintf(w, "%s: %s\n", key, r.Header[key])
		w.Header().Set(key, r.Header[key])
	}
	fmt.Fprintln(res, "Header全部数据:", header)
	fmt.Fprintf(w, "--------------\n")
	fmt.Fprintf(w, "the key: %s\n", r.Header["Accept-Encoding"])
	fmt.Fprintf(w, "the key: %s\n", r.Header.Get("Accept-Encoding"))

}
func main() {
	server := http.Server{
		Addr: "127.0.0.1:8080",
	}
	http.HandleFunc("/headers", headers)
	server.ListenAndServe()
}
